import { Map } from 'immutable'
import * as actionTypes from './constants'
const defaultState = Map({
  currentSongDetail: {},
  songLyric: [],
  commentList: [],
  totalComment: 0,
  simiPlaylists: [],
  simiSongs:[]
})
export default function reducer(state = defaultState, action) {
  switch (action.type) {
    case actionTypes.CHANGE_CURRENT_SONG_DETAIL_ACTION:
      return state.set('currentSongDetail', action.currentSongDetail)
    case actionTypes.CHANGE_SONG_LYRIC_ACTION:
      return state.set('songLyric', action.songLyric)
    case actionTypes.CHANGE_SONG_COMMENTS_ACTION:
      return state.set('commentList', action.commentList)
    case actionTypes.CHANGE_SONG_COMMENTS_TOTAL_ACTION:
      return state.set('totalComment', action.totalComment)
    case actionTypes.CHANGE_SONG_SIMI_PLAYLIST_ACTION:
      return state.set('simiPlaylists', action.simiPlaylists)
    case actionTypes.CAHNGE_SONG_SIMI_SONG_ACTION:
      return state.set('simiSongs',action.simiSongs)
    default:
      return state
  }
}